package com.metadata_system.common.db.entity;

import java.util.Date;
import javax.persistence.*;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@Table(name = "md_queue")
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class Queue {
    @Id
    private Integer id;

    /**
     * 用户ID
     */
    @Column(name = "user_id")
    private Integer userId;

    /**
     * 队列类型: ImportProjectNodeData.项目节点数据-导入 ExportProjectNodeData.项目节点数据-导出
     */
    private String type;

    /**
     * 状态: 0.执行中 1.执行完毕 2.执行失败
     */
    private Integer status;

    /**
     * 备注信息
     */
    private String info;

    /**
     * 执行参数
     */
    @Column(name = "exec_params")
    private String execParams;

    /**
     * 执行信息
     */
    @Column(name = "exec_data")
    private String execData;

    /**
     * 结果参数
     */
    @Column(name = "result_params")
    private String resultParams;

    /**
     * 创建时间
     */
    @Column(name = "created_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date createdTime;

    /**
     * 更新时间
     */
    @Column(name = "updated_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date updatedTime;
}